\hypertarget{class_sound_engine_q_audio}{
\section{SoundEngineQAudio Class Reference}
\label{class_sound_engine_q_audio}\index{SoundEngineQAudio@{SoundEngineQAudio}}
}


QAudio sound engine to play sound effects.  


\subsection*{Public Member Functions}
\begin{DoxyCompactItemize}
\item 
\hypertarget{class_sound_engine_q_audio_a7809e6ca7284adf2702e6c17b4316808}{
\hyperlink{class_sound_engine_q_audio_a7809e6ca7284adf2702e6c17b4316808}{SoundEngineQAudio} (QObject $\ast$parent=0)}
\label{class_sound_engine_q_audio_a7809e6ca7284adf2702e6c17b4316808}

\begin{DoxyCompactList}\small\item\em Constructs QAudio sound engine. \item\end{DoxyCompactList}\item 
\hypertarget{class_sound_engine_q_audio_af325096eaa3e1d94b83de7efc860a243}{
\hyperlink{class_sound_engine_q_audio_af325096eaa3e1d94b83de7efc860a243}{$\sim$SoundEngineQAudio} ()}
\label{class_sound_engine_q_audio_af325096eaa3e1d94b83de7efc860a243}

\begin{DoxyCompactList}\small\item\em Destructs QAudio sound engine. \item\end{DoxyCompactList}\item 
void \hyperlink{class_sound_engine_q_audio_ae58e6b5ac33f6c03cf4bb446fc6587e9}{reset} ()
\begin{DoxyCompactList}\small\item\em Resets playback to initial state. \item\end{DoxyCompactList}\item 
\hypertarget{class_sound_engine_q_audio_a3ddb803ea3570718bb2430a3cb915f89}{
qint64 \hyperlink{class_sound_engine_q_audio_a3ddb803ea3570718bb2430a3cb915f89}{dataDuration} () const }
\label{class_sound_engine_q_audio_a3ddb803ea3570718bb2430a3cb915f89}

\begin{DoxyCompactList}\small\item\em Gets audio duration of the sound effect as microseconds. \item\end{DoxyCompactList}\item 
void \hyperlink{class_sound_engine_q_audio_af0757e66ab0fb2a0a0aa968a33f28207}{play} (\hyperlink{soundengine_8h_a608db89860fa5723001cc530622ba5bf}{SoundEffectType})
\begin{DoxyCompactList}\small\item\em Plays the sound effect given at the attribute {\itshape soundEffect\/}. \item\end{DoxyCompactList}\item 
\hypertarget{class_sound_engine_q_audio_a8f9d72cb949b96484533c7dd8e9d360a}{
void \hyperlink{class_sound_engine_q_audio_a8f9d72cb949b96484533c7dd8e9d360a}{addEffectBuffer} (\hyperlink{soundengine_8h_a608db89860fa5723001cc530622ba5bf}{SoundEffectType} effectType, QByteArray $\ast$buffer)}
\label{class_sound_engine_q_audio_a8f9d72cb949b96484533c7dd8e9d360a}

\begin{DoxyCompactList}\small\item\em Adds sound effect data to buffer array. \item\end{DoxyCompactList}\item 
\hypertarget{class_sound_engine_q_audio_a5fb11199c72cb458b2d208442c993042}{
void \hyperlink{class_sound_engine_q_audio_a5fb11199c72cb458b2d208442c993042}{setSoundLength} (\hyperlink{soundengine_8h_a608db89860fa5723001cc530622ba5bf}{SoundEffectType} effectType, qint64 length)}
\label{class_sound_engine_q_audio_a5fb11199c72cb458b2d208442c993042}

\begin{DoxyCompactList}\small\item\em Adds sound effect length to array. \item\end{DoxyCompactList}\item 
void \hyperlink{class_sound_engine_q_audio_a50499a7acaf52f8ba11fd1212fb45c97}{setAudioFormat} (const QAudioFormat \&)
\begin{DoxyCompactList}\small\item\em Sets the QAudioFormat for the sound effects. \item\end{DoxyCompactList}\item 
\hypertarget{class_sound_engine_q_audio_abeabb71e1a2334f501a622e0681a59f1}{
QAudioOutput $\ast$ \hyperlink{class_sound_engine_q_audio_abeabb71e1a2334f501a622e0681a59f1}{audioOutput} ()}
\label{class_sound_engine_q_audio_abeabb71e1a2334f501a622e0681a59f1}

\begin{DoxyCompactList}\small\item\em Gets QAudioOutput. \item\end{DoxyCompactList}\item 
\hypertarget{class_sound_engine_q_audio_ac83c7654eb6ed948522d5cdd0c19bc1c}{
void \hyperlink{class_sound_engine_q_audio_ac83c7654eb6ed948522d5cdd0c19bc1c}{setAudioOutput} (QAudioOutput $\ast$audioOutput)}
\label{class_sound_engine_q_audio_ac83c7654eb6ed948522d5cdd0c19bc1c}

\begin{DoxyCompactList}\small\item\em Sets QAudioOutput. \item\end{DoxyCompactList}\end{DoxyCompactItemize}
\subsection*{Private Slots}
\begin{DoxyCompactItemize}
\item 
\hypertarget{class_sound_engine_q_audio_a24a4638e346d285b29a25ea1fc483456}{
void \hyperlink{class_sound_engine_q_audio_a24a4638e346d285b29a25ea1fc483456}{audioNotify} ()}
\label{class_sound_engine_q_audio_a24a4638e346d285b29a25ea1fc483456}

\begin{DoxyCompactList}\small\item\em Slot for the QAudioOutput notify() signals. \item\end{DoxyCompactList}\item 
\hypertarget{class_sound_engine_q_audio_a99d31da49bfdd49bcdfd4343e5491076}{
void \hyperlink{class_sound_engine_q_audio_a99d31da49bfdd49bcdfd4343e5491076}{audioStateChanged} (QAudio::State)}
\label{class_sound_engine_q_audio_a99d31da49bfdd49bcdfd4343e5491076}

\begin{DoxyCompactList}\small\item\em Slot for the QAudioOutput stateChanged() signals. \item\end{DoxyCompactList}\end{DoxyCompactItemize}
\subsection*{Private Member Functions}
\begin{DoxyCompactItemize}
\item 
\hypertarget{class_sound_engine_q_audio_a9c161529e2ac90d7c9aa60457446e691}{
void \hyperlink{class_sound_engine_q_audio_a9c161529e2ac90d7c9aa60457446e691}{stopPlayback} ()}
\label{class_sound_engine_q_audio_a9c161529e2ac90d7c9aa60457446e691}

\begin{DoxyCompactList}\small\item\em Stops the sound playback. \item\end{DoxyCompactList}\item 
\hypertarget{class_sound_engine_q_audio_ae60073c34ff8059130172940a6930529}{
void \hyperlink{class_sound_engine_q_audio_ae60073c34ff8059130172940a6930529}{setState} (QAudio::State)}
\label{class_sound_engine_q_audio_ae60073c34ff8059130172940a6930529}

\begin{DoxyCompactList}\small\item\em Sets playback state. \item\end{DoxyCompactList}\item 
\hypertarget{class_sound_engine_q_audio_a6aebe6557513347503881056ba3b834b}{
void \hyperlink{class_sound_engine_q_audio_a6aebe6557513347503881056ba3b834b}{setPlayPosition} (qint64)}
\label{class_sound_engine_q_audio_a6aebe6557513347503881056ba3b834b}

\begin{DoxyCompactList}\small\item\em Sets playback position given at {\itshape position\/} as microseconds. \item\end{DoxyCompactList}\end{DoxyCompactItemize}
\subsection*{Static Private Member Functions}
\begin{DoxyCompactItemize}
\item 
\hypertarget{class_sound_engine_q_audio_ad3e9480901f30c70884fa6a8103c74fe}{
static qint64 \hyperlink{class_sound_engine_q_audio_ad3e9480901f30c70884fa6a8103c74fe}{audioDuration} (const QAudioFormat \&, qint64)}
\label{class_sound_engine_q_audio_ad3e9480901f30c70884fa6a8103c74fe}

\begin{DoxyCompactList}\small\item\em Gets audio duration for given {\itshape format\/} and amount of {\itshape bytes\/} as microseconds. \item\end{DoxyCompactList}\end{DoxyCompactItemize}
\subsection*{Private Attributes}
\begin{DoxyCompactItemize}
\item 
\hypertarget{class_sound_engine_q_audio_a0487a92460367e2ea09d33c5f67e6c76}{
QByteArray $\ast$ \hyperlink{class_sound_engine_q_audio_a0487a92460367e2ea09d33c5f67e6c76}{soundsBufferArray} \mbox{[}NumberOfSounds\mbox{]}}
\label{class_sound_engine_q_audio_a0487a92460367e2ea09d33c5f67e6c76}

\begin{DoxyCompactList}\small\item\em Sound effects data array. \item\end{DoxyCompactList}\item 
\hypertarget{class_sound_engine_q_audio_a9afd2356bd29de45b7351b22c6d72dea}{
qint64 \hyperlink{class_sound_engine_q_audio_a9afd2356bd29de45b7351b22c6d72dea}{soundsLengthArray} \mbox{[}NumberOfSounds\mbox{]}}
\label{class_sound_engine_q_audio_a9afd2356bd29de45b7351b22c6d72dea}

\begin{DoxyCompactList}\small\item\em Sound effects length array. \item\end{DoxyCompactList}\item 
\hypertarget{class_sound_engine_q_audio_a31bacf3a1d6dbb1e1c696612f7edd56d}{
QAudio::State \hyperlink{class_sound_engine_q_audio_a31bacf3a1d6dbb1e1c696612f7edd56d}{state}}
\label{class_sound_engine_q_audio_a31bacf3a1d6dbb1e1c696612f7edd56d}

\begin{DoxyCompactList}\small\item\em Status of the sound engine. \item\end{DoxyCompactList}\item 
\hypertarget{class_sound_engine_q_audio_a90fa1b52226f8325130926ab6d8d6509}{
QAudioFormat \hyperlink{class_sound_engine_q_audio_a90fa1b52226f8325130926ab6d8d6509}{audioFormat}}
\label{class_sound_engine_q_audio_a90fa1b52226f8325130926ab6d8d6509}

\begin{DoxyCompactList}\small\item\em Audio format of the output. \item\end{DoxyCompactList}\item 
\hypertarget{class_sound_engine_q_audio_ab9ec69db31a59141aedbd08761bcb8fe}{
QAudioOutput $\ast$ \hyperlink{class_sound_engine_q_audio_ab9ec69db31a59141aedbd08761bcb8fe}{audioOutputDevice}}
\label{class_sound_engine_q_audio_ab9ec69db31a59141aedbd08761bcb8fe}

\begin{DoxyCompactList}\small\item\em Output audio device. \item\end{DoxyCompactList}\item 
\hypertarget{class_sound_engine_q_audio_ae7a7810b2bf4a35932b17b3aa46f5be4}{
qint64 \hyperlink{class_sound_engine_q_audio_ae7a7810b2bf4a35932b17b3aa46f5be4}{playPosition}}
\label{class_sound_engine_q_audio_ae7a7810b2bf4a35932b17b3aa46f5be4}

\begin{DoxyCompactList}\small\item\em Current playback position as microseconds. \item\end{DoxyCompactList}\item 
\hypertarget{class_sound_engine_q_audio_ad99277b3754487f12b57e7a259549f21}{
QBuffer \hyperlink{class_sound_engine_q_audio_ad99277b3754487f12b57e7a259549f21}{audioOutputIODevice}}
\label{class_sound_engine_q_audio_ad99277b3754487f12b57e7a259549f21}

\begin{DoxyCompactList}\small\item\em Audio output device. \item\end{DoxyCompactList}\item 
\hypertarget{class_sound_engine_q_audio_a5d336441119cc75a656b632afaccbc9d}{
qint64 \hyperlink{class_sound_engine_q_audio_a5d336441119cc75a656b632afaccbc9d}{dataLength}}
\label{class_sound_engine_q_audio_a5d336441119cc75a656b632afaccbc9d}

\begin{DoxyCompactList}\small\item\em Lenght of currently playing sound data. \item\end{DoxyCompactList}\end{DoxyCompactItemize}


\subsection{Detailed Description}
QAudio sound engine to play sound effects. NOTE! \hyperlink{class_sound_engine_q_audio}{SoundEngineQAudio} not preferred to be used at games. Output latency of the QAudio is not sufficient.

\begin{DoxySeeAlso}{See also}
\hyperlink{class_sound_engine}{SoundEngine} 
\end{DoxySeeAlso}


\subsection{Member Function Documentation}
\hypertarget{class_sound_engine_q_audio_af0757e66ab0fb2a0a0aa968a33f28207}{
\index{SoundEngineQAudio@{SoundEngineQAudio}!play@{play}}
\index{play@{play}!SoundEngineQAudio@{SoundEngineQAudio}}
\subsubsection[{play}]{\setlength{\rightskip}{0pt plus 5cm}void SoundEngineQAudio::play (
\begin{DoxyParamCaption}
\item[{{\bf SoundEffectType}}]{ soundEffect}
\end{DoxyParamCaption}
)}}
\label{class_sound_engine_q_audio_af0757e66ab0fb2a0a0aa968a33f28207}


Plays the sound effect given at the attribute {\itshape soundEffect\/}. 

\begin{DoxySeeAlso}{See also}
\hyperlink{soundengine_8h_a608db89860fa5723001cc530622ba5bf}{SoundEffectType}. 
\end{DoxySeeAlso}
\hypertarget{class_sound_engine_q_audio_ae58e6b5ac33f6c03cf4bb446fc6587e9}{
\index{SoundEngineQAudio@{SoundEngineQAudio}!reset@{reset}}
\index{reset@{reset}!SoundEngineQAudio@{SoundEngineQAudio}}
\subsubsection[{reset}]{\setlength{\rightskip}{0pt plus 5cm}void SoundEngineQAudio::reset (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
)}}
\label{class_sound_engine_q_audio_ae58e6b5ac33f6c03cf4bb446fc6587e9}


Resets playback to initial state. 

Any ongoing playback is set to stopped state. \hypertarget{class_sound_engine_q_audio_a50499a7acaf52f8ba11fd1212fb45c97}{
\index{SoundEngineQAudio@{SoundEngineQAudio}!setAudioFormat@{setAudioFormat}}
\index{setAudioFormat@{setAudioFormat}!SoundEngineQAudio@{SoundEngineQAudio}}
\subsubsection[{setAudioFormat}]{\setlength{\rightskip}{0pt plus 5cm}void SoundEngineQAudio::setAudioFormat (
\begin{DoxyParamCaption}
\item[{const QAudioFormat \&}]{ format}
\end{DoxyParamCaption}
)}}
\label{class_sound_engine_q_audio_a50499a7acaf52f8ba11fd1212fb45c97}


Sets the QAudioFormat for the sound effects. 

Also initializes QAudioOutput. 

The documentation for this class was generated from the following files:\begin{DoxyCompactItemize}
\item 
soundengineqaudio.h\item 
soundengineqaudio.cpp\end{DoxyCompactItemize}
